(function(){



    fetch('http://chst.vip:1234/api/getinlanddiscount')
    .then(body=>body.json())
    .then(res=>{
        // console.log(res);
        let {result:thing}=res

        console.log(thing);

        let html=""
        thing.forEach(item => {
            html+=
            `
            <a href="/pages/inlandproduct.html?productid=${item.productId}">
            <li>
                <div>${item.productImg}</div>
                <div class="info_one">${item.productName}</div>
                <div class="info_two">${item.productPrice}</div>
                <div class="info_three"> ${item.productFrom}  | ${item.productTime}</div>
            </li>
        </a>
            `
            
        });
        $('#product ul').html(html)
    })



    // 点击返回顶部
    $('.top_one').click(function(){
        $("html,body").animate({
            scrollTop:0
        },1000)
    })


    
})()